import { integer, time, paragraph, date, name, pick, sentence, boolean } from '../util';

function getList() {
  const len = 20;
  const result = [];
  for (let i = 0; i < len; i++) {
    result.push({
      date: date(),
      name: name(),
      age: integer(6, 18),
      desc: sentence(3, 6),
      sex: pick(['male', 'female']),
      enable: boolean(),
    });
  }
  return result;
}

export default [
  {
    url: '/mock/getListData',
    type: 'get',
    // off: true,
    // proxyUrl: 'http://yapi.int.medlinker.com/mock/279/magic-interface/user/v1/GetUserInfo',
    template: () => {
      return {
        errcode: 0,
        errmsg: '',
        data: {
          list: getList(),
          page: 1,
          pageSize: 20,
          total: 33,
        },
      };
    },
  },
];
